package cc.vv.baselibrary.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;

import cc.vv.baselibrary.R;
import cc.vv.baselibrary.bean.PublicViewHolder;
import cc.vv.baselibrary.view.jzvd.JZVideoPlayer;
import cc.vv.baselibrary.view.jzvd.JZVideoPlayerStandard;

/**
 * 视频播放
 * Created by Chen.qi on 2018/9/19.
 */

public class NormalVideoPlayActivity extends BaseActivity {

    private String videoPath = "";

    private JZVideoPlayerStandard jcVideoPlayerStandard;

    @Override
    protected int initLayoutRes() {
        return R.layout.activity_normal_video_player;
    }

    @Override
    protected PublicViewHolder initViewHolderObject() {
        return null;
    }

    @Override
    protected void baseOnClick(int viewId) {

    }

    @Override
    protected void initView(@Nullable Bundle bundle) {
        super.initView(bundle);
        try {
            videoPath = getIntent().getStringExtra("VideoPathLogo");
        } catch (Exception e) {
            e.printStackTrace();
            videoPath = "";
        }
        jcVideoPlayerStandard = findViewById(R.id.jps_player_playing);

        jcVideoPlayerStandard.setUp(videoPath, JZVideoPlayer.SCREEN_WINDOW_FULLSCREEN, this, "");

    }

    @Override
    protected void onPause() {
        super.onPause();
    }

    @Override
    protected void onStop() {
        super.onStop();
        JZVideoPlayer.releaseAllVideos();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        try {
            System.gc();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }


}
